var pageParam = {};

$(function() {
	$('#vue_vm_list div').hide();
});

elderOutOrder_findBySubjectRoomId();

function elderOutOrder_findBySubjectRoomId() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();

	find_basic_by_json(path+'/elderOutOrder/findBySubjectRoomId', {subjectRoomId:getLoginedUser().subjectRoomId,status:1}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				getChepingUrl:function(elderId, elderName, elderCardId) {
					return getChepingUrl(elderId, elderName, elderCardId);
				}
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function goNextPage() {
	pageParam.elderId = $('input:radio[name="elder"]:checked').attr('id');
	pageParam.elderName = $('input:radio[name="elder"]:checked').attr('elderName');
	pageParam.buildingId = $('input:radio[name="elder"]:checked').attr('buildingId');
	pageParam.buildingName = $('input:radio[name="elder"]:checked').attr('buildingName');
	pageParam.floorId = $('input:radio[name="elder"]:checked').attr('floorId');
	pageParam.floorName = $('input:radio[name="elder"]:checked').attr('floorName');
	pageParam.roomId = $('input:radio[name="elder"]:checked').attr('roomId');
	pageParam.roomNumber = $('input:radio[name="elder"]:checked').attr('roomNumber');
	pageParam.roomType = $('input:radio[name="elder"]:checked').attr('roomType');
	pageParam.bedNumber = $('input:radio[name="elder"]:checked').attr('bedNumber');
	pageParam.beHospitalId = $('input:radio[name="elder"]:checked').attr('beHospitalId');
	if(isEmpty(pageParam.elderId)) {
		alert('请选择一个长者');
		return;
	}
	
	var url = '6-2-9cybg-1.html?pageParam=' + encodeURIComponent(JSON.stringify(pageParam));
	window.open(url);
}

function deleteBatch() {
	deleteBatch_basic(path+'/elderOutOrder/deleteBatch');
}
